import {defineStore} from 'pinia'

export const useUserStore = defineStore('user',{
    state(){
        return {
            username:localStorage.getItem('username')||'',
            // email:'',
        }
    },
    actions:{
        setUserName(payload){
            this.username = payload
            localStorage.setItem('username',payload)
        },
        logout(){
            // this.username = ''
            localStorage.clear()
        }
    }
})